<template>
  <div class="main-con channelInfo">
    <!-- 首页标题栏 -->
    <div class="main-title">
        渠道管理
    </div>

    <!-- 表格数据 -->
    <div class="table-con" v-loading="loading">
      <el-table :data="tableData" size="mini" :header-cell-style="{background:'#f8f8f8'}" style="width: 100%">
        <el-table-column type="index" label="序号" width="50" align="center" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="platformName" label="渠道" width="" align="center" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="productCount" label="商品数" width="" align="center" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="storeCount" label="门店数" width="" align="center" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column label="操作" width="" align="center">
          <template slot-scope="scope">
            <div class="handleBtn">
              <span @click="handleUpdate(scope.$index, scope.row)">商品溢价设置</span>
            </div>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import {
    queryChannelInfo,
} from "@/common/service/productManagement/channelInfo.js";
export default {
    name: "channelInfo",
    data() {
        return {
            //表格数据
            tableData: [],//表格信息
            loading: false//表格加载动画
        };
    },
    created() {
        //初始化表格数据
        this._queryChannelInfo();
    },
    methods: {
        /*----------------------------查询操作----------------------------*/
        //查询仓库信息表格数据
        _queryChannelInfo() {
            this.loading = true;
            queryChannelInfo(this.formData)
                .then(res => {
                    this.loading = false;
                    this.tableData = res;
                })
                .catch(err => {
                    this.loading = false;
                    this.$message.error(err.message);
                });
        },

        /*----------------------------编辑操作----------------------------*/
        handleUpdate(index,row){
            this.$router.push({
                path: '/index/channelInfo/editChannelInfo',
                query: {
                    editType: 'update',
                    editText: '编辑',
					          editId: row.id
                }
            });
        }
    }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>